import 'package:flutter/material.dart';

class CollectCandy extends StatelessWidget {
  final count;
  const CollectCandy({this.count = 10, Key key}) : super(key: key);

  pop(context) {
    Navigator.of(context).pop(true);
  }

  @override
  Widget build(BuildContext context) {
    Future.delayed(Duration(seconds: 2), () {
      this.pop(context);
    });
    return GestureDetector(
      child: Container(
        alignment: Alignment.center,
        color: Colors.white,
        // margin: EdgeInsets.only(left: 40,right: 40,top: 100),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Container(
              margin: EdgeInsets.only(bottom: 20),
              child: Image.asset(
                'assets/images/candy.png',
              ),
            ),
            Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Text(
                  "${this.count}",
                  style: TextStyle(
                    color: Color(0xFFFFB32C),
                    fontSize: 30,
                    fontFamily: 'Avenir Next LT Pro',
                    fontWeight: FontWeight.bold,
                  ),
                ),
                SizedBox(
                  width: 10,
                ),
                Expanded(child: Text(
                  "Candies has been deposited to your candy box.",
                  textAlign: TextAlign.left,
                  style: TextStyle(
                    color: Color(0xFF041D57),
                    fontSize: 13,
                    fontFamily: 'Avenir Next LT Pro',
                    fontWeight: FontWeight.bold,
                  ),
                )),
              ],
            ),
            SizedBox(
              height: 30,
            ),
          ],
        ),
      ),
    );
  }
}
